package com.xsomnus.open.imv2.util;


import com.xsomnus.open.imv2.attr.Attributes;
import io.netty.channel.Channel;
import io.netty.util.Attribute;


/**
 * @author @xsomnus666_xiawenye★
 * @since 2019/4/25 0025 11:15
 * 当你发现自己的才华撑不起野心时，就请安静下来学习吧
 */
public class LoginUtils {

    public static void markAsLogin(Channel channel) {
        channel.attr(Attributes.LOGIN).set(true);
    }

    public static boolean hasLogin(Channel channel) {
        Attribute<Boolean> loginAttr = channel.attr(Attributes.LOGIN);
        return loginAttr.get() != null;
    }

}
